package com.niiwoo.civet.trade.dto.response.contract;

import com.niiwoo.tripod.provider.exception.NoSuchEnumValueException;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Date;

/**
 * 自动、批量投资委托授权协议书
 * Created by zhangwanli on 2018/1/20.
 */
@Setter
@Getter
public class CommissionAuthAgreementResponseDTO implements Serializable {
    private static final long serialVersionUID = 4497797043648960490L;

    private Long id;    //授权记录id
    private Date authTime;  //授权时间
    private String contractNo;  //正式协议书合同号
    private SignStatus signStatus;  //合同签署状态
    private String viewUrl; //正式协议书合同查看url
    private String downloadUrl; //正式协议书合同下载url

    @AllArgsConstructor
    @Getter
    public enum SignStatus {
        UNSIGNED((byte) 0, "未签"),
        SIGNED((byte) 1, "已签");

        private final Byte value;
        private final String desc;

        public static SignStatus enumOf(Byte value) {
            for (SignStatus status : values()) {
                if (status.value.equals(value)) {
                    return status;
                }
            }
            throw new NoSuchEnumValueException("SignStatus:" + value);
        }
    }

}
